/*
 * Decompiled with CFR 0.150.
 * 
 * Could not load the following classes:
 *  cn.hutool.core.util.ObjectUtil
 *  org.springframework.beans.factory.annotation.Autowired
 *  org.springframework.stereotype.Service
 *  tk.mybatis.mapper.entity.Example
 */
package com.gys.spliteService.impl;

import cn.hutool.core.util.ObjectUtil;
import com.gys.common.exception.BusinessException;
import com.gys.mapper.GaiaSdRechargeCardMapper;
import com.gys.mapper.entity.GaiaSdRechargeCard;
import com.gys.spliteService.RechargeCardService;
import com.gys.spliteService.data.RechargeCardInData;
import com.gys.spliteService.data.RechargeCardOutData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

@Service
public class RechargeCardServiceImpl
implements RechargeCardService {
    @Autowired
    private GaiaSdRechargeCardMapper rechargeCardDao;

    @Override
    public RechargeCardOutData getCardInfo(RechargeCardInData inData) {
        RechargeCardOutData outData = new RechargeCardOutData();
        Example example = new Example(GaiaSdRechargeCard.class);
        example.createCriteria().andEqualTo("clientId", inData.getClientId()).andEqualTo("gsrcId", inData.getGsrcId()).andEqualTo("gsrcStatus", "1");
        GaiaSdRechargeCard rechargeCard2 = (GaiaSdRechargeCard)this.rechargeCardDao.selectOneByExample(example);
        if (ObjectUtil.isEmpty(rechargeCard2)) {
            throw new BusinessException("\u672a\u67e5\u8be2\u5230\u50a8\u503c\u5361\u53f7\uff0c\u8bf7\u6838\u5bf9\u540e\u91cd\u65b0\u8f93\u5165\uff01");
        }
        outData.setGsrcAddress(rechargeCard2.getGsrcAddress());
        outData.setGsrcAmt(rechargeCard2.getGsrcAmt());
        outData.setGsrcBrId(rechargeCard2.getGsrcBrId());
        outData.setGsrcMobile(rechargeCard2.getGsrcMobile());
        outData.setGsrcId(rechargeCard2.getGsrcId());
        outData.setGsrcName(rechargeCard2.getGsrcName());
        outData.setGsrcSex(rechargeCard2.getGsrcSex());
        return outData;
    }
}

